
#requests模块编码流程
# 指定url
# 发起请求
#获取响应数据
#持久化存储

import requests
if __name__ == '__main__':

    url = 'http://www.sougou.com'
    res = requests.get(url)
    #text属性存储响应数据的字符串表示，res.text获取响应数据的字符串表示
    page_text = res.text
    with open('sougou.html', 'w', encoding='utf-8') as f:
        f.write(page_text)
    print('爬取完毕！')